package com.study.gank

import android.app.Application
import com.study.gank.di.component.ApiComponent
import com.study.gank.di.component.DaggerApiComponent
import com.study.gank.di.module.ApiModule
import com.study.gank.di.module.AppModule
import javax.inject.Inject

class App : Application() {

    init {
        app = this
    }

    @Inject
    lateinit var apiComponent: ApiComponent

    override fun onCreate() {
        super.onCreate()
        DaggerApiComponent.builder().apiModule(ApiModule())
                .appModule(AppModule(this)).build().inject(this)
    }

    companion object {
        lateinit var app: App
    }
}